{- SLA.inc.orc -- Orc program SLA.inc
 - 
 - $Id$
 - 
 - Created by akattepu on 02-Aug-2012 10:31:29
 -}

include "Latency.inc"
include "CPUutilization.inc"
include "InterQuery.inc"
include "Cost.inc"
include "Security.inc"
include "Reliability.inc"

--def Ambient(QoStype) = Ift(QoStype = ResponseTime) >> signal ; stop
       
--def NonAmbient(QoStype) = Ift(QoStype = InterQueryTime) >> signal 
--                          |
 --                         Ift(QoStype = Cost) >> signal 
 --                         | 
 --                         Ift(QoStype = SecurityLevel) >> signal 
  --                        ; stop
   
def class NonAmbient(QoStype) = 

 def QoSCompete(Number,Number) :: Number
 def QoSCompete(q1,q2) = head(sortBy((<:), [q1,q2]))

signal

def class Ambient(QoStype,competition) = 
  
 def QoSCompete(Number,Number) :: Number
 def QoSCompete(q1,q2) = head(sortBy(competition,  [q1,q2]))
    
signal                                          